# compile all cleanwriter txt files in ../deidun/pub
# $Id: cleanwriteall.py 35 2009-09-20 00:59:12Z andrewfn@gmail.com $
import os

cleanwriter='P:/CODE/CPP/Cleanwriter/Release/CleanWriter.exe '
target='..\\\\deidun\\\\pub\\\\'
#os.system('cd ' + target)
for root, dirs, files in os.walk('..\deidun\pub'):
  for name in files:
    #print 'root: ' + root + ' name: ' + name
    #print 'checking ' + os.path.join(root,name)
    if name == "top.txt": 
      continue
    if name[-4:] == '.txt':
#      print 'processing: ' + os.path.join(root,name)
#      os.system(cleanwriter + os.path.join(root,name))
      print 'processing: ' + target + name
      os.system(cleanwriter + target + name)

raw_input('press enter to continue...')

